<?php
/**
 *+------------------
 * Lflow
 *+------------------
 * Copyright (c) 2023~2030 gitee.com/liu_guan_qing All rights reserved.本版权不可删除，侵权必究
 *+------------------
 * Author: Mr.April(405784684@qq.com)
 *+------------------
 */
declare (strict_types=1);

namespace lflow\entity;

use lflow\helper\JsonHelper;

class Order
{

    use Common;

    /** @var string @table */
    private string $table = 'wf_order';

    /** @primary */
    private string $id;
    /** @field */
    private int $version = 1;
    /** @field */
    private string $process_id;
    /** @field */
    private string $creator;
    /** @field */
    private string $create_time;
    /** @field */
    private string $parent_id;
    /** @field */
    private string $parent_node_name;
    /** @field */
    private string $expire_time;
    /** @field */
    private string $last_update_time;
    /** @field */
    private string $last_updator;
    /** @field */
    private ?int $priority;
    /** @field */
    private string $order_no;
    /** @field */
    private string $variable;

    public function getProcessId(): string
    {
        return $this->process_id ?? '';
    }

    public function setProcessId(string $processId): void
    {
        $this->process_id = $processId;
    }

    public function getCreator(): string
    {
        return $this->creator ?? '';
    }

    public function setCreator(string $creator): void
    {
        $this->creator = $creator;
    }

    public function getCreateTime(): string
    {
        return $this->create_time ?? '';
    }

    public function setCreateTime(string $createTime): void
    {
        $this->create_time = $createTime;
    }

    public function getParentId(): string
    {
        return $this->parent_id ?? '';
    }

    public function setParentId(string $parentId): void
    {
        $this->parent_id = $parentId;
    }

    public function getExpireTime()
    {
        return $this->expire_time ?? '';
    }

    public function setExpireTime(string $expireTime): void
    {
        $this->expire_time = $expireTime;
    }

    public function getLastUpdateTime(): string
    {
        return $this->last_update_time ?? '';
    }

    public function setLastUpdateTime(string $lastUpdateTime): void
    {
        $this->last_update_time = $lastUpdateTime;
    }

    public function getLastUpdator(): string
    {
        return $this->last_updator ?? '';
    }

    public function setLastUpdator(string $lastUpdator): void
    {
        $this->last_updator = $lastUpdator;
    }

    public function getPriority(): int
    {
        return $this->priority ?? 1;
    }

    public function setPriority(int $priority): void
    {
        $this->priority = $priority;
    }

    public function getId(): string
    {
        return $this->id ?? '';
    }

    public function setId(string $id): void
    {
        $this->id = $id;
    }

    public function getParentNodeName()
    {
        return $this->parent_node_name ?? '';
    }

    public function setParentNodeName(string $parentNodeName): void
    {
        $this->parent_node_name = $parentNodeName;
    }

    public function getVariable(): string
    {
        return $this->variable ?? '';
    }

    public function getVariableMap(): array
    {
        $map = JsonHelper:: fromJson($this->variableSS);
        if ($map == null) return new \stdClass();
        return $map;
    }

    public function setVariable(string $variable): void
    {
        $this->variable = $variable;
    }

    public function getOrderNo(): string
    {
        return $this->order_no ?? '';
    }

    public function setOrderNo(string $orderNo): void
    {
        $this->order_no = $orderNo;
    }

    public function getVersion(): int
    {
        return $this->version ?? 1;
    }

    public function setVersion(int $version): void
    {
        $this->version = $version;
    }

    public function toString(): string
    {
        return json_encode(get_object_vars($this));

    }

    public function toArray(): array
    {
        return get_object_vars($this);
    }

}